package com.h5lib.nchuoffice;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 全局cookies
 * @author farmer
 *
 */
public class Cookies implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3586206959052806018L;
	
	/**
	 * cookies
	 */
	private static Map<String, String> data = new HashMap<String, String>();
	
	private Cookies(){
		
	}
	
	/**
	 * 获取cookies
	 * @return
	 */
	public static Map<String, String> getCookies(){
		return data;
	}
	
	/**
	 * 获取cookie
	 * @param key
	 * @return
	 */
	public static String getCookie(String key){
		return data.get(key);
	}
	
	/**
	 * 添加cookie
	 * @param key
	 * @param value
	 */
	public static void addCookie(String key , String value){
		data.put(key, value);
	}
	
	/**
	 * 添加cookies
	 * @param cookies
	 */
	public static void addCookies(Map<String, String> cookies){
		data.putAll(cookies);
	}
	
}
